// pages/components/page_display/setScreen/setScreen.js
var request_api = require('../../../../utils/require_api.js');
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    showdapei: {
      type: String,
      value: ''
    },
    
  },

  /**
   * 组件的初始数据
   */
  data: {
    image_url:[],
    // image_url:[
    //   {
    //     id:1,
    //     sub1:[
    //       {
    //         collocation: "套头卫衣", content: "", itemno: 'A19333-16784', pkey: "15065", price: "569", update_time: "2019-10-16", url: "https://ossyy.yifabu.vip/yueye/img/c8bd242011a056bc1c0b6ecbb8de573b.jpg~S1"
    //       }, {
    //         collocation: "封胶衣", content: "", itemno: 'A19333-16784', pkey: "15069", price: "569", update_time: "2019-10-16", url: "https://ossyy.yifabu.vip/yueye/img/5947ebdda6caedf38c3c3bdc792803dc.jpg~S1"
    //       },
    //       {
    //         collocation: "长款外套", content: "", itemno: 'A19333-16784', pkey: "15065", price: "1099", update_time: "2019-10-16", url: "https://ossyy.yifabu.vip/yueye/img/f118e3a6c5a9b486eb98c6818a4aa8f9.jpg~S1"
    //       },
    //       {
    //         collocation: "圆领毛衣", content: "", itemno: 'A19333-16784', pkey: "15065", price: "569", update_time: "2019-10-16", url: "https://ossyy.yifabu.vip/yueye/img/e46017023105bd008586feb93b4d39e7.jpg~S1"
    //       },
    //       {
    //         collocation: "长款棉衣", content: "", itemno: 'A19333-16784', pkey: "15065", price: "569", update_time: "2019-10-16", url: "https://ossyy.yifabu.vip/yueye/img/4ae66b94bea71198fdcf9b19dd1cf2d8.jpg~S1"
    //       },
    //     ],
    //     update_time: "2019-10-16"
    //   },
    //   {
    //     id: 2,
    //     sub1: [
    //       {
    //         collocation: "套头卫衣", itemno:'A19333-16784',  content: "", pkey: "15065", price: "569", update_time: "2019-10-16", url: "https://ossyy.yifabu.vip/yueye/img/c8bd242011a056bc1c0b6ecbb8de573b.jpg~S1"
    //       }, {
    //         collocation: "封胶衣", content: "", pkey: "15069", itemno: 'A19333-16784', price: "569", update_time: "2019-10-16", url: "https://ossyy.yifabu.vip/yueye/img/5947ebdda6caedf38c3c3bdc792803dc.jpg~S1"
    //       },
    //       {
    //         collocation: "长款外套", content: "", pkey: "15065", itemno: 'A19333-16784', price: "1099", update_time: "2019-10-16", url: "https://ossyy.yifabu.vip/yueye/img/f118e3a6c5a9b486eb98c6818a4aa8f9.jpg~S1"
    //       },
    //       {
    //         collocation: "圆领毛衣", content: "", pkey: "15065", price: "569", itemno: 'A19333-16784', update_time: "2019-10-16", url: "https://ossyy.yifabu.vip/yueye/img/e46017023105bd008586feb93b4d39e7.jpg~S1"
    //       },
    //       {
    //         collocation: "长款棉衣", content: "", pkey: "15065", price: "569", itemno: 'A19333-16784', update_time: "2019-10-16", url: "https://ossyy.yifabu.vip/yueye/img/4ae66b94bea71198fdcf9b19dd1cf2d8.jpg~S1"
    //       },
    //     ],
    //     update_time: "2019-10-17"
    //   },
    // ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    //点击查询资源的时候触发
    search_resources(event){
      console.log(event.detail.value,"this is search_resources 68");
      var that = this 
      request_api.request({
        "cmd": "weixin_api|get_wx_resources",
        "paras": [
          { name: "comdition",value: event.detail.value},
          { name: "current_company_key", value: wx.getStorageSync("company_key")}//现在正式库的还没改脚本
        ]
      }, //需要传的 data
        function (res) {
          console.log(res,"this is setScreen.js where search_resources function 79 ");
          that.data.image_url = res.data.result;
          that.setData({
            image_url: that.data.image_url
          })
        },
        function () {
          console.log("错误");
        },
      )
    },
  //资源页面查询的时候触发
    searchInput(){

    },
    //跳转到资源详情页面
    resources_detail(){
      wx.navigateTo({
        url: '/pages/page/sheping/resource_detail/resource_detail',
      })
    },

  //点击跳转到上传页面
    shangchuangbindtap(event){
      console.log(event, "this is event 70 shangchuangbindtap");
      wx.navigateTo({
        url: '/pages/page/sheping/uploadPage/uploadPage',
      })
    },
  //点击图片触发
    onTapImage(){

    },
  }
})
